{% extends '::base.html.twig' %}

{% block title %}{% trans %}Change My Password{% endtrans %}{% endblock %}

{% block body %}

<div class="row-fluid whiteWrapper">

    <form class="form-horizontal profile" action="{{ path('user_change_my_password') }}" method="post" {{ form_enctype(form) }}>

        {% for formError in form.vars.errors %}
        <div class="alert-error alert">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {{ formError.message }}
        </div>
        {% endfor %}

        {% if message %}
        <div class="alert-success alert">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {% trans %}Edited Successfully{% endtrans %}.
        </div>
        {% endif %}

        <fieldset>
            <legend>{% trans %}Change Password{% endtrans %}</legend>
            <hr class="smallHr" />

            <div class="control-group">
                <label class="control-label">{% trans %}Current Password{% endtrans %}</label>
                <div class="controls">
                    {{ form_widget(form.oldPassword, {'attr': {'class': 'input-xlarge'} }) }}
                </div>
            </div>

            {% for formError in form.oldPassword.vars.errors %}
            <div class="control-group">
                <div class="alert-error alert">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    {{ formError.message }}
                </div>
            </div>
            {% endfor %}

            <div class="control-group">
                <label class="control-label">{% trans %}New Password{% endtrans %}</label>
                <div class="controls">
                    {{ form_widget(form.userPassword.Password, {'attr': {'class': 'input-xlarge', 'autocomplete': 'off'} }) }}
                </div>
            </div>

            {% for formError in form.userPassword.Password.vars.errors %}
            <div class="control-group">
                <div class="alert-error alert">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    {{ formError.message }}
                </div>
            </div>
            {% endfor %}

            <div class="control-group">
                <label class="control-label">{% trans %}ReType Password{% endtrans %}</label>
                <div class="controls">
                    {{ form_widget(form.userPassword.RePassword, {'attr': {'class': 'input-xlarge', 'autocomplete': 'off'} }) }}
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">&nbsp;</label>
                <div class="controls">
                    {{ form_rest(form) }}
                    <button class="btn blue submit" type="submit">{% trans %}Save{% endtrans %}</button>
                </div>
            </div>

        </fieldset>
    </form>
</div>
{% endblock %}